<?php
class BoletinesHelper extends Helper{  
   
	public function registro($id){
   	 	App::import('Model', 'BoletinesAcademico');
        $this->BoletinesAcademico = new BoletinesAcademico;
        $this->data = $this->BoletinesAcademico->find('first', array('all', 'conditions'=>array('BoletinesAcademico.id'=>$id)));        
        return $this->data;
   }
   
	public function existe_registro($bimestre, $year, $zona_id) {
        App::import('Model', 'BoletinesAcademico');
        $this->BoletinesAcademico = new BoletinesAcademico;         
        $existe = $this->BoletinesAcademico->find('count', array('fields'=>'BoletinesAcademico.id','conditions'=>array('BoletinesAcademico.bimestre'=>$year."-".$bimestre, 
        																		'BoletinesAcademico.zona_id'=>$zona_id)));
        return $existe;
   }
} 
?>